<?php

/**
 * SatriBlog模板，适用于个人博客。
 *
 * @package SatriBlog
 * @author XiaYuxuan
 * @version 1.0
 * @link https://blog.satri.cn
 */
// if(equipment() == 1){
//     echo "手机访问";
// }else{
//     echo "电脑访问";
// }
if (!defined('__TYPECHO_ROOT_DIR__')) {
    exit;
}

$this->need('header.php');
?>
<!--判断首页-->
<?php if ($_SERVER['PHP_SELF'] == "/index.php") : ?>
    <div class="banner">
        <div class="banner-wrapper">
            <a style="background-image:url('https://blog.satri.cn/usr/uploads/common-bg.jpg')">
                <h2 style="letter-spacing:2px;">日志
                    <br>
                    <p style="font-size:15px;letter-spacing:1px;">三十功名尘与土，八千里路云和月</p>
                </h2>
            </a>
        </div>
    </div>
<?php endif; ?>
<div id="body">
    <div class="container" style="padding:0 10px;">
        <div class="row">
            <?php if (equipment() == 1) : ?>

            <? else : ?>

            <? endif; ?>
            <div class="content" id="main" role="main">
                    <?php $this->widget('Widget_Archive@daily', 'type=category', 'mid=1')->to($category); ?>
                    
                    <?php while ($category->next()) : ?>
                        <div class="post_all" itemscope itemtype="http://schema.org/BlogPosting">
                            <div class="post_title_all">
                                <h2><a href="<?php $category->permalink() ?>"><?php $category->title() ?></a>
                                </h2>
                            </div>
                            <div class="post_preview_all">
                                <div class="desc">
                                    <a href="<?php $category->permalink() ?>" style="color:#222;">
                                        <?php if (equipment() == 1) : ?>
                                        <?php
                                        if ($category->attachments(1)->attachment->isImage) {
                                            $category->excerpt(45, '...');
                                        } else {
                                            $category->excerpt(60, '...');
                                        }
                                        ?>
                                        <? else : ?>
                                          <?php
                                        if ($category->attachments(1)->attachment->isImage) {
                                            $category->excerpt(80, '...');
                                        } else {
                                            $category->excerpt(130, '...');
                                        }
                                        ?>
                                        <? endif; ?>
                                    </a>
                                </div>
                                <!--如是有图文章，则显示缩略图-->
                                <?php if ($category->attachments(1)->attachment->isImage) : ?>
                                    <div class="post_img" style="background-image:url('<?php $category->attachments(1)->attachment->url(); ?>')"></div>
                                <?php endif; ?>
                            </div>
                            <div class="post_meta_all">
                                <span class="post_date"><?php $category->date(); ?></span>
                                <span class="post_views" style="color:#3354AA;"><?php //$this->category(',');
                                                                                ?><?php echo "日志"; //$this->category(',');
                                                                                                                ?></span>
                                <span class="post_comment"><?php echo $category->charactersNum() . '字'; //$category->commentsNum('0 评论', '1 评论', '%d 评论');
                                                            ?></span>
                            </div>
                        </div>
                    <?php endwhile; ?>
                    <?php $category->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
                    
                </div>
            <?php //$this->need('sidebar.php');
            ?>
            <?php $this->need('footer.php'); ?>